﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TestProject.ServiceGarantiaContrato;

namespace TestProject
{
    /// <summary>
    /// Summary description for TesteGarantiaContrato
    /// </summary>
    [TestClass]
    public class TesteGarantiaContrato
    {
        public TesteGarantiaContrato()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        [TestMethod]
        public void TestAtualizarGarantiaContrato()
        {
            ServiceGarantiaContrato.IGarantiaContrato client =
                new ServiceGarantiaContrato.GarantiaContratoClient();

            List<GarantiaContrato> list = new List<GarantiaContrato>();

            var item = new GarantiaContrato();

            item.CdUsuario = "aronascimento";
            item.CodBem = 0;
            item.CodCliente = 8580;
            item.CodContrato = "AGE151794";
            item.CodGarantia = 7343;
            item.CodInstrumento = 0;
            item.CodNatureza = 0;
            item.id = 0;
            item.DtInicio = new DateTime(2013, 12, 3);
            item.DtTermino = new DateTime(2013, 12, 31);
            item.IdParametro = 1;
            item.VlParametro = "0.680000";
            item.IdMotivo = 1;
            item.DsJustificativa = "Teste Alexandre";

            list.Add(item);

            client.AtualizarGarantiaContrato(list.ToArray(), "aronascimento", false);

        }
    }
}
